<?php
            
use app\model\Theme; 


/**
 *  关于插件中的class类名规则和验证请仔细查看 /core/model/route.php；
 *  关于变量命名等规范详细查看文档系统编码规范：http://wiki.yixuan.net/project-12/doc-227/
 *  以下文档才是最重要！！！！！最重要！！！！！最重要！！！！！
 *  关于插件化功能目录、系统配置参数保存、插件配置项保存及验证、注意事项等，详细查看文档系统中插件化整理：http://wiki.yixuan.net/project-12/doc-113/
 */
class Index_Page extends PluginMobilePage {

    function main()
    {
        global $_P,$_G,$_S,$_C;
        $fromtype = $_P['from'];
        if ($fromtype=='wxapp'){
            $themeid = isset($_P['themeid'])?$_P['themeid']:'';
            $type = isset($_P['type'])?intval($_P['type']):0;
            $workerid = isset($_P['workerid'])?$_P['workerid']:'';
            $theme = Theme::getThemeById($themeid);
            if (!$themeid || !$theme['id']) {
                return_json(1,'活动入口不正确');
            }
            $page_index = max(1,intval($_P['page']));
            $page_size = 12;
            $page_start = ($page_index-1)*$page_size;
            $res = DemoModel::demo1($themeid,$type,$page_start,$page_size);
            return_json(0,'',$res);
        }else{
            return_json(1,'非法请求');
        }
    }
}